package com.cn.star.java8;

import java.util.function.DoublePredicate;

public class LambdaUsage {
	
	public static int add(MyInterface myInterface) {
		return myInterface.add(1, 1);
	}
	public static void main(String[] args) {
		MyInterface myInterface = (x,y) -> x+y;
		myInterface.add(1, 2);
		DoublePredicate doublePredicate = (x)->{
			if(x>0) return true;
			else return false;
		};
		doublePredicate.test(100);
	}
	
	@FunctionalInterface
	public interface MyInterface{
		
		int add(int x,int y);
		
		default int minus(int x,int y) {
			return x-y;
		}
	}
}
